/* 透明单例
  客户端或则说使用者不需要知道要按单例使用
*/
export{}
const Window = (function(){
  let window: Window
  const Window = function (this: Window) {
    if(window){
      return window
    }else{
      return (window = this)
    }
  }
  return Window
})()

const w1 = new (Window as any)()
const w2 = new (Window as any)()
console.log(w1 === w2)
